Microsoft Copilot Studio

Live Hub connects to a bot built in Microsoft Copilot Studio, Microsoft's no-code bot platform. Copilot Studio does not use Bot Framework Composer: everything it needs is built in.

Bot management in Live Hub is built on the AudioCodes VoiceAI Connect platform. Its notes on integrating Copilot Studio are worth reading first.

Choose an authentication method

Copilot Studio reaches Live Hub over Direct Line, a standard HTTPS channel. Choose one of the following two authentication methods, and collect its credentials before you create the connection:

Method What you collect Live Hub option
Direct Line Speech channel A token endpoint URL Direct line
Web channel security A secret key and an environment ID Direct line enhanced authentication

Use web channel security when you want the extra security, or when your bot requires authentication.

Get the Direct Line Speech token endpoint

The token endpoint belongs to the bot's Direct Line Speech channel in Copilot Studio.

To get the token endpoint:

  1. In Copilot Studio, open your bot from the Copilots page.

  2. On the toolbar, select the Channels tab, and then select Direct Line Speech.

  3. Next to 'Token Endpoint', click Copy.

    The Direct Line Speech pane with the token endpoint URL

Get the web channel secret key and environment ID

Both values come from the bot's settings in Copilot Studio: the secret key from Web channel security, and the environment ID from Metadata under Advanced.

To get the secret key and environment ID:

  1. In Copilot Studio, open your bot from the Copilots page, and then click Settings on the toolbar.

  2. Click Security, then Authentication, and then select No authentication.

    The authentication setting in Copilot Studio

  3. Click Security, then Web channel security, and then click Copy next to the secret you want.

    The web channel security page with the secret key

  4. Click Advanced, expand Metadata, and then copy 'Environment ID'. It also appears in your bot's URL in the browser address bar.

    The Metadata group showing the environment ID

Create the bot connection

With the credentials for your chosen method ready, create the bot connection in Live Hub.

To create a bot connection:

  1. In the Navigation pane, select Bot connections, and then click Add new voice bot connection or Add new assist bot connection.

    The Connect your Bot framework picker

  2. Select Microsoft Copilot Studio, and then click Next.

    The Copilot Studio connection details

  3. In the 'Bot connection name' field, enter a name for the bot connection.

  4. Provide the credentials for the method you chose:

    • Direct line: In the 'Bot URL' field, paste the token endpoint URL.
    • Direct line enhanced authentication: In the 'Secret key' field, paste the secret, and then in the 'Environment ID' field, enter the environment ID, for example Default-1971c72c-793c-42f9-83fa-45d1b86kef85.
  5. From the 'Live Hub region' drop-down list, select the region your Live Hub voice infrastructure runs in. See Global region support.

  6. Click Next.

    The bot connection settings

  7. Select a speech-to-text service and a text-to-speech service.

  8. Click Create.

Messages and events in Copilot Studio

Key concepts

Three terms recur in the Copilot Studio integration:

Term Meaning
Topic A conversation flow in Copilot Studio. A topic is triggered by a set of phrases, or from another topic.
Activity A control command sent to Live Hub rather than to the caller: start recording, switch language, and so on.
Notification A message sent from the Session Manager to the bot, not necessarily tied to the current topic: the start-conversation event, for example.

Copilot Studio currently supports the start-conversation event only.

Send a message

To add session or activity parameters to a message, paste the JSON into the 'Channel data' section of the message.

The Channel data section of a Copilot Studio message

For a question, use the code editor:

  1. Set the question text and parameters, click the ellipsis in the top-right corner, and then select Open code editor.

    Opening the code editor from a question

  2. The editor shows the whole topic as YAML.

    The topic shown as YAML

  3. Change the prompt to carry both text and channelData.

    The prompt with text and channelData

  4. Add the activity parameters you want.

    Activity parameters added to a question

    An example of activity parameters

Send an event to Live Hub

To send an event with no message to the caller, use Copilot Studio's Send an event option, then enter the event name in 'Name' and the JSON in 'Value'.

The Send an event option

The event name and value fields

Receive events from Live Hub

The bot catches events with an event-received trigger topic, in which the event name property is the condition that checks Activity.name.

Call details arrive in the channel event at the start of the conversation.

  1. Start a new topic and change the default trigger to Event received.

    Changing the trigger to Event received

  2. Set the condition to check that Activity.name equals channel.

    The condition checking Activity.name

  3. To keep a value, use Parse value.

    The Parse value option

  4. In 'Parse value', use the formula with System.Activity.ChannelData.

    The Parse value formula

  5. To keep the whole response, from the 'Data type' drop-down list, select From sample data, and then paste the channelData JSON from call initiation.

    Selecting From sample data

  6. Save it as a new parameter. Select Global to use the variable across topics.

    Saving the parameter as global